<div class="action-dialog-model-fixed-body">
    <div class="detailsBox">
        <h3>近六个月营业额情况</h3>
        <form action="<@url value='/mainMonthInfoRest/save'/>" method="post" name="shopForm" class="action-ajax-form action-ajax-form-valid" >
            <div class="detaiTab">
                <input id="id" type="hidden" value="${view.id}" name="id">
                <input id="loanapplyNo" type="hidden" value="${loanapplyNo}" name="loanapplyNo">

                <div class="detaiTab">
                <table width="100%" cellspacing="0" cellpadding="0" border="0">
                    <tbody>

                    <tr>
                        <td width="15%"  align="right" class="bg"><font color="red">*</font>第一个月（万元）： </td>
                        <td width="23%"><input type="text"  class="tabInp w50 action-valid-field" data-action-valid-rule="required;number;maxlength:15;reg:^\d*$|^(\d+(\.\d{1,2})*)$;" data-action-valid-msg-number="金额只能为数字" data\-action\-valid\-msg\-required="第一个月不能为空！" id="turnover1th" value="${view.turnover1th}" size="20" name="turnover1th">   
                            <span class="action-field-error" for="turnover1th" style="color:red"></span>
                        </td>
                        <td width="15%"  align="right" class="bg"><font color="red">*</font>第二个月（万元）： </td>
                        <td width="15%"><input type="text"  class="tabInp w50 action-valid-field" data-action-valid-rule="required;number;maxlength:15;reg:^\d*$|^(\d+(\.\d{1,2})*)$;" data-action-valid-msg-number="金额只能为数字" data\-action\-valid\-msg\-required="第二个月不能为空！" id="turnover2th" value="${view.turnover2th}" size="20" name="turnover2th">  
                            <span class="action-field-error" for="turnover2th" style="color:red"></span>
                        </td>
                    </tr>
                    <tr>
                    	<td width="15%"  align="right" class="bg"><font color="red">*</font>第三个月（万元）： </td>
                        <td><input type="text" class="tabInp w50 action-valid-field" data-action-valid-rule="required;number;maxlength:15;reg:^\d*$|^(\d+(\.\d{1,2})*)$;" data-action-valid-msg-number="金额只能为数字" data\-action\-valid\-msg\-required="第三个月不能为空！" id="turnover3th" value="${view.turnover3th}" size="20" name="turnover3th">  
                            <span class="action-field-error" for="turnover3th" style="color:red"></span>
                        </td>
                        <td width="15%"  align="right" class="bg"><font color="red">*</font>第四个月（万元）： </td>
                        <td><input type="text"  class="tabInp w50 action-valid-field" data-action-valid-rule="required;number;maxlength:15;reg:^\d*$|^(\d+(\.\d{1,2})*)$;" data-action-valid-msg-number="金额只能为数字" data\-action\-valid\-msg\-required="第四个月不能为空！" id="turnover4th" value="${view.turnover4th}" size="20" name="turnover4th">   
                            <span class="action-field-error" for="turnover4th" style="color:red"></span>
                        </td>
                    </tr>
                    <tr>
                        <td width="15%"  align="right" class="bg"><font color="red">*</font>第五个月（万元）： </td>
                        <td><input type="text"  class="tabInp w50 action-valid-field" data-action-valid-rule="required;number;maxlength:15;reg:^\d*$|^(\d+(\.\d{1,2})*)$;" data-action-valid-msg-number="金额只能为数字" data\-action\-valid\-msg\-required="第五个月不能为空！" id="turnover5th" value="${view.turnover5th}" size="20" name="turnover5th">  
                            <span class="action-field-error" for="turnover5th" style="color:red"></span>
                        </td>
                        <td width="15%"  align="right" class="bg"><font color="red">*</font>第六个月（万元）： </td>
                        <td><input type="text" class="tabInp w50 action-valid-field" data-action-valid-rule="required;number;maxlength:15;reg:^\d*$|^(\d+(\.\d{1,2})*)$;" data-action-valid-msg-number="金额只能为数字" data\-action\-valid\-msg\-required="第六个月不能为空！" id="turnover6th" value="${view.turnover6th}" size="20" name="turnover6th">  
                            <span class="action-field-error" for="turnover6th" style="color:red"></span>
                        </td>
                    </tr>
                <!--
                    <tr>
                        <td  align="left" class="bg">门店名下（非实际控制人）的资产负债情况： </td>
                        <td colspan="5"><input type="text"  id="assetsliabilities" value="${view.assetsliabilities}" size="20" name="assetsliabilities"> </td>

                    </tr>
                 -->
                    </tbody>
                </table>
            </div>
            
            
            </div>
            

            <div class="clearfix tac mtb20">
                <input type="submit" class="btn_auto_30 btn_blue" value="提交">&nbsp;
            </div>
        </form>

 
    </div>

    </div>
   <@js>
   
function bgdzmap(obj){
	var location = $('#bgdz').html().replace(/[\r\n &nbsp;]/g,'');
	obj.href='http://api.map.baidu.com/geocoder?address='+location+'&output=html&src=';
}

function mddzmap(obj){
	var location = $('#mddz').html().replace(/[\r\n &nbsp;]/g,'');
	obj.href='http://api.map.baidu.com/geocoder?address='+location+'&output=html&src=';
}

function yyzzdzmap(obj){
	var location = $('#yyzzdz').html().replace(/[\r\n &nbsp;]/g,'');
	obj.href='http://api.map.baidu.com/geocoder?address='+location+'&output=html&src=';
}
   
	$(function() {
		var loanType = $('#loanType').val();
		var sdurl = '/oaoro2odatasub/jsonword';
		if(loanType=='BP'||loanType=='BP_JX'||loanType=='SG'||loanType=='YC'||loanType=='SC'){
			var sdurl = '/oaoro2odatasub/jsonwordNew';
		}
		$('#shopnameRead').combogrid({
				loadMsg:'数据加载中,请稍后...',
				panelWidth: 500,
				idField: 'cno',
				textField: 'cname',
				url: sdurl,
				method: 'get',
				 rownumbers:true,//序号   
		      collapsible:false,//是否可折叠的   
				columns: [[
					{field:'cno',title:'流水号',width:80},
					{field:'ccode',title:'客户sd号',width:120},
					{field:'cname',title:'客户名简称',width:150},
					{field:'cnames',title:'客户全称',width:150}
				]],
				fitColumns: true,
				delay: 1100,
				keyHandler: {
					up: function() {
					},
					down: function() {
					},
					enter: function() {
					},
					query: function(q) {
						if(loanType=='BK'){
							$('#shopnameRead').combogrid("grid").datagrid("reload", { 'reloadname': q });
								$('#shopnameRead').combogrid("setValue", q);
						}else{
							if(q||q.length>3){
								$('#shopnameRead').combogrid("grid").datagrid("reload", { 'reloadname': q });
								$('#shopnameRead').combogrid("setValue", q);
								item=true;
							}
						}
					}
				 },
				 onClickRow:function(rowIndex, rowData){
					$("#shopname").val(rowData.cname);
					$("#shopno").val(rowData.cno);
					$("#shopcode").val(rowData.ccode);
				},
				onLoadSuccess:function(){
				}
			});
		})

   provinceOnchange();
        function provinceOnchange(){
        var provinceCode = $("#select_provinceId").val();
        var url="<@url value='/common/findCityByProvinceCode' domain='${crmUrl}'/>";
        $.ajax({
        type: "GET",
        url:url,
        data:{provinceCode:provinceCode},
        dataType:"jsonp",
        jsonp:"_callback",
        success:function(result){
   var t = $("#select_cityId").find("option:selected").text();
        $("#select_cityId").empty();
        $("#select_cityId").append("<option value=''>请选择</option>");

        $.each(result.data,function(key,value){
   if(t==value[1]){
   $("#select_cityId").append("<option selected = 'selected' value='"+value[0]+"'>"+value[1]+"</option>");
   }else{
   $("#select_cityId").append("<option value='"+value[0]+"'>"+value[1]+"</option>");
   }
        });
        }
        });
   cityOnchange();
        }


        function cityOnchange(){
        var cityCode = $("#select_cityId").val();
        var url="<@url value='/common/findDistrictByCityCode' domain='${crmUrl}'/>";
        $.ajax({
        type: "GET",
        url:url,
        data:{cityCode:cityCode},
        dataType:"jsonp",
        jsonp:"_callback",
        success:function(result){
   var t = $("#select_districtId").find("option:selected").text();
        $("#select_districtId").empty();
        $("#select_districtId").append("<option value=''>请选择</option>");

        $.each(result.data,function(key,value){
   if(t==value[1]){
   $("#select_districtId").append("<option selected = 'selected' value='"+value[0]+"'>"+value[1]+"</option>");
   }else{
   $("#select_districtId").append("<option value='"+value[0]+"'>"+value[1]+"</option>");
   }
        });
        }
        });
        }

        function shopprovinceOnchange(){
        var provinceCode = $("#select_shop_provinceId").val();
        var url="<@url value='/common/findCityByProvinceCode' domain='${crmUrl}'/>";
        $.ajax({
        type: "GET",
        url:url,
        data:{provinceCode:provinceCode},
        dataType:"jsonp",
        jsonp:"_callback",
        success:function(result){
   var t = $("#select_shop_cityId").find("option:selected").text();
        $("#select_shop_cityId").empty();
        $("#select_shop_cityId").append("<option value=''>请选择</option>");

        $.each(result.data,function(key,value){
   if(t==value[1]){
   $("#select_shop_cityId").append("<option selected = 'selected' value='"+value[0]+"'>"+value[1]+"</option>");
   }else{
   $("#select_shop_cityId").append("<option value='"+value[0]+"'>"+value[1]+"</option>");
   }
        });
        }
        });
   shopcityOnchange();
        }


        function shopcityOnchange(){
        var cityCode = $("#select_shop_cityId").val();
        var url="<@url value='/common/findDistrictByCityCode' domain='${crmUrl}'/>";
        $.ajax({
        type: "GET",
        url:url,
        data:{cityCode:cityCode},
        dataType:"jsonp",
        jsonp:"_callback",
        success:function(result){
   var t = $("#select_shop_districtId").find("option:selected").text();
        $("#select_shop_districtId").empty();
        $("#select_shop_districtId").append("<option value=''>请选择</option>");

        $.each(result.data,function(key,value){
   if(t==value[1]){
   $("#select_shop_districtId").append("<option selected = 'selected' value='"+value[0]+"'>"+value[1]+"</option>");
   }else{
   $("#select_shop_districtId").append("<option value='"+value[0]+"'>"+value[1]+"</option>");
   }
        });
        }
        });
        }

        $(function(){
        //1.配偶情况

        var shoptype=$("#shoptype").val();

        if(shoptype == 'MAN' ){
        $('#all_amount').show();
        $("input[name='totalAmount']").attr('data-action-valid-rule','required;');
        }else{
        $('#all_amount').hide();
        $("input[name='totalAmount']").removeAttr('data-action-valid-rule');
        }
        });

        $("#shoptype").change(function(){
        var shoptype=$("#shoptype").val();
        if(shoptype == 'MAN' ){
        $('#all_amount').show();
        $("input[name='totalAmount']").attr('data-action-valid-rule','required;');
        }else{
        $('#all_amount').hide();
        $("input[name='totalAmount']").removeAttr('data-action-valid-rule');
        }
        });
    </@js>
    <@jsRender/>